package com.face.server.entity;


import lombok.Data;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.CompoundIndexes;
import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.List;

/**
 * 具体宿舍信息
 */
@Document
@CompoundIndexes(
        @CompoundIndex(name = "room_build_id", def = "{roomNumber:1, dormitoryBuildNum:1}")
)
@Data
public class Dormitory extends Entity {


    // 楼幢
    @DBRef
    private DormitoryBuild dormitoryBuild;

    // 存储学生姓名
    private List<String> studentsName;

    // 楼幢号
    private int dormitoryBuildNum;


    // 寝室号
    private int roomNumber;

    // 是否可用 true 可用
    private boolean disable = true;

}
